﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Xml;

namespace TestCase_1
{
    class clsSetUp
    {
        public void sad()
        {
            XmlDocument doc = new XmlDocument();
            doc.Load("data.xml");

            XmlNodeList xnList = doc.SelectNodes("/setting");
            foreach (XmlNode xn in xnList)
            {
                string loc = xn["location"].InnerText;
                string updat = xn["update_time"].InnerText;
                string col = xn["collection"].InnerText;
                string start = xn["start_up"].InnerText;

                Console.WriteLine("Location: {0}", loc);
                Console.WriteLine("Update Time: {0}", updat);
                Console.WriteLine("Collection: {0}", col);
                Console.WriteLine("Satrt up: {0}", start);

                clsSettingSystem obj = new clsSettingSystem();
                obj.Collection = col;
                obj.UpdateTime = Convert.ToInt32(updat);
                obj.Location = loc;
                if (start.Equals("true"))
                { obj.StartUp = true; }
                else
                { obj.StartUp = false; }
            }
        }
    }
}
